package org.dromara.system.api.feign;

import org.dromara.common.core.domain.R;
import org.dromara.system.api.feign.fallback.SystemPermissionClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Set;

import static org.dromara.common.core.constant.ServerNameConstants.SYSTEM_SERVER_NAME;

/**
 * @author: zhou shuai
 * @date: 2025/7/12 16:07
 * @version: v1
 */
@FeignClient(contextId = "system-permission-api", name = SYSTEM_SERVER_NAME, fallbackFactory = SystemPermissionClientFallBack.class)
public interface SystemPermissionClient {

    /**
     * 获取角色数据权限
     */
    @GetMapping(value = "/api/system/permission/role")
    R<Set<String>> getRolePermission(@RequestParam("userId") Long userId);

    /**
     * 获取菜单数据权限
     */
    @GetMapping(value = "/api/system/permission/menu")
    R<Set<String>> getMenuPermission(@RequestParam("userId") Long userId);

}
